<extend name="Public/base"/>
<block name="style">
    <link href="__STATIC__/select2/select2.css" rel="stylesheet" type="text/css"></link>
    <link href="__STATIC__/select2/select2-bootstrap.css" rel="stylesheet" type="text/css"></link>
    <script src="__STATIC__/select2/select2.js"></script>
</block>
<block name="body">
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>
    <div class="well">
        <p><strong>提示：</strong> 每个客户最多只能设置3个标签，请注意不要设置多于三个标签，否则不会生效。 </p>
        <p>     基于标签的个性化菜单只会按客户最后一个标签匹配，因此为达到精准匹配个性化菜单，请尽量每个客户只设置一个标签。 </p>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn" href="{:U('index')}" >全部</a>
            <a class="btn" href="{:U('index',array('subscribe'=>1))}" >正在关注</a>
            <a class="btn" href="{:U('index',array('subscribe'=>0))}" >不在关注</a>
            <a class="btn" href="{:U('importClient')}" >同步粉丝</a>
        </div>
        <!-- 高级搜索 -->
        <include file="serch" />

    <!-- 数据表格 -->
        <div class="cf">
            <div id="clientList">
                <ul style="background:none;display: inline-block;margin: 0;padding: 20px 0 0;text-align: center;">
                    <volist name="_list" id="vo">
                            <li class="fl" style="list-style-type: none;background-color: #f8f8f8;border: 1px solid #dfdfdf;box-shadow: 0 2px 3px #e8e8e8;color:#666;font-size: 13px;margin: 13px;text-align: left;width: 325px;height: 200px">
                            <div class="cf" style="margin: 20px">
                                <span class="share-personage-face fl">
                                    <img class="img-circle" src="{$vo.headimgurl}" alt="{$vo.nickname}" style="border: 1px solid #c7c7c7;height: 50px;width: 50px;"/>
                                </span>
                                <div class="share-personage-con fl" style="margin: 2px 0 0 10px;position: relative;width: 200px;">
                                    <p>
                                        <a title="{$vo.nickname}" target="_blank" href="{:U('detail',array('id'=>$vo['id']))}" class="share-personage-name">{$vo.nickname}</a>
                                        <span>
                                                <switch name="vo.sex">
                                                    <case value="1">男</case>
                                                    <case value="2">女</case>
                                                    <default />保密
                                                </switch>
                                        </span>
                                    </p>
                                    <p>
                                        备注：<a href="#" data-name="remark" data-type="text" data-url="{:U('setClientInfo')}" data-pk="{$vo.id}" data-title="设置备注" class="editable editable-click remark" style="display: inline; background-color: rgba(0, 0, 0, 0);">{$vo.remark}</a>
                                    </p>
                                    <p>
                                        <empty name="vo.uid">未绑定帐号<else />绑定帐号：{$vo.uid|get_nickname}</empty>
                                    </p>
                                    <p class="share-personage-msg clear">
                                        <eq name="vo.subscribe" value="1">
                                            <i class="icon-ok"></i>
                                            <else />
                                            <i class="icon-remove"></i>
                                        </eq>

                                        <span> 关注时间：{:Date('Y-m-d',$vo['subscribe_time'])}</span>
                                    </p>
                                </div>
                            </div>
                            <hr />
                            <div class="share-personage-describe" style="font-size: 13px;margin: 20px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
                                <p><notempty name="vo.country"><span class="label label-important">{$vo.country}</span></notempty>
                                    <notempty name="vo.city"><span class="label label-info"> {$vo.city}</span></notempty>
                                    <a href="#" data-name="tagid_list" data-type="select2" data-pk="{$vo.id}" data-url="{:U('setClientInfo')}" data-title="设置tags" class="editable editable-click tags" style="display: inline; background-color: rgba(0, 0, 0, 0);">{$vo.tags}</a>
                                </p>
                            </div>
                        </li>
                    </volist>
                </ul>
            </div>
        </div>

  <!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
</div>
</block>

<!-- 加载底部JS -->
<block name="script">
<include file="Public/footjs" />

    <script>

        //turn to inline mode
        $.fn.editable.defaults.mode = 'inline';

        var tags = {$allTags};

        $(document).ready(function() {
            $('.tags').editable({
                inputclass: 'input-small',
                select2: {
                    tags: tags,
                    tokenSeparators: [",", " "]
                },
                multiple: true
            });

            $(".remark").editable();
        });
    </script>
</block>
